<!-- 复制微信号 -->

<template>
  <span class="content" @click="copyWx">
    <span>Excel656</span>
    <textarea id="wxArea" class="mf-area" ref="wxArea" name="" cols="30" value="Excel656" rows="10">Excel656</textarea>
  </span>
</template>
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import {ref} from 'vue'
const wxArea = ref<any>()
function copyWx () {
  if(wxArea.value){
    wxArea.value.select()
    document.execCommand('copy')
    ElMessage.closeAll()
    ElMessage({
      type:'success',
      message:'已复制微信号',
      duration:5000
    })
  }
  
}
</script>
<style lang="scss" scoped>
.mf-area {
  position: absolute;
  top: -10000px;
  left: 0px;
  width: 100%;
  height: 0px;
  border: none;
  outline: none;
  .content{
    cursor: pointer;
    color:#409EFF;
    text-decoration: underline;
    
  }
}
</style>